Librerías
library(dplyr)
library(data.table)
library(lubridate)
library(scales)
library(ggplot2)
library(downloader)
Funciones
isValidEmail <- function(x) {
grepl("\\<[A-Z0-9._%+-]+@[A-Z0-9.-]+\\.[A-Z]{2,}\\>", as.character(x), ignore.case=TRUE)
}
leerArchivo <- function(nombre) {
temp <- fread(nombre, sep = "~", quote = "", encoding = "UTF-8", stringsAsFactors = TRUE, fill = TRUE, data.table = TRUE)
colnames(temp) <- toupper(colnames(temp))
if (anyDuplicated(colnames(temp))) {
colnames(temp) <- make.unique(colnames(temp) )
}
temp
}
El objetivo de este script es el filtrado de los datos de origen de e-Preselec ESP para su carga en Cornerstone para el ámbito Holding.
En la subcarpeta datos_originales/ están todos los archivos fuente obtenidos de e-Preselec ESP
ptm <- proc.time()
files <- list.files(path="datos_originales", pattern="*.csv", full.names=T, recursive=FALSE)
print (files)
[1] "datos_originales/01-Candidatos_Datos_Personales.csv"
[2] "datos_originales/02-Candidatos_Formacion_Parte1.csv"
[3] "datos_originales/03-Candidatos_Formacion_Parte2.csv"
[4] "datos_originales/06-Candidatos_Idiomas.csv"
[5] "datos_originales/07-Candidatos_Idiomas_Titulaciones.csv"
[6] "datos_originales/08-Candidatos_Idiomas_Detalles.csv"
[7] "datos_originales/09-Candidatos_Informatica_parte1.csv"
[8] "datos_originales/10-Candidatos_Informatica_parte2.csv"
[9] "datos_originales/11-Candidatos_Informatica_parte3.csv"
[10] "datos_originales/12-Candidatos_Informatica_parte4.csv"
[11] "datos_originales/13-Candidatos_Experiencia_Empresas_Parte1.csv"
[12] "datos_originales/14-Candidatos_Experiencia_Empresas_Parte2.csv"
[13] "datos_originales/15-Candidatos_Experiencia_Profesional.csv"
[14] "datos_originales/16-Candidatos_Otros_Datos.csv"
[15] "datos_originales/17-Candidatos_Otros_Datos_Documentos.csv"
[16] "datos_originales/18-Candidatos_Agenda.csv"
[17] "datos_originales/19-Candidatos_Agenda_Citaciones.csv"
[18] "datos_originales/19-Procesos_Masivos.csv"
[19] "datos_originales/20-Candidatos_Agenda_VEntrevista.csv"
[20] "datos_originales/20-Procesos_Especialistas.csv"
[21] "datos_originales/21-Procesos_Becarios.csv"
[22] "datos_originales/22-Procesos_Puestos.csv"
[23] "datos_originales/23-Procesos_VEntrevista.csv"
[24] "datos_originales/24-Procesos_Evaluacion_Candidato_Cp.csv"
[25] "datos_originales/25-Procesos_Evaluacion_Candidato_Test.csv"
[26] "datos_originales/26-Procesos_Evaluacion_Candidato_Idiomas.csv"
[27] "datos_originales/27-Procesos_Evaluacion_Candidato_Resultados_Parte1.csv"
[28] "datos_originales/28-Procesos_Evaluacion_Candidato_Resultados_Parte2.csv"
[29] "datos_originales/29-Procesos_Evaluacion_Candidato_Evaluacion_BBVA.csv"
[30] "datos_originales/30-Procesos_Evaluacion_Candidato_Entrevista_Historico.csv"
[31] "datos_originales/31-Procesos_Citaciones_Eventos.csv"
[32] "datos_originales/32-Procesos_Citaciones_Fases.csv"
[33] "datos_originales/33-Procesos_Candidatos_Inscritos.csv"
[34] "datos_originales/34-Procesos_Becarios_Progreso.csv"
[35] "datos_originales/35-Procesos_Especialistas_Progreso.csv"
[36] "datos_originales/36-Gestion_Bolsa_Masivos.csv"
[37] "datos_originales/37-Ofertas.csv"
[38] "datos_originales/38-Ofertas_Plantillas.csv"
[39] "datos_originales/39-Ofertas_Preguntas.csv"
[40] "datos_originales/40-Ofertas_Respuestas.csv"
[41] "datos_originales/41-Candidatos_En_Oferta.csv"
[42] "datos_originales/42-Becas_Centros.csv"
[43] "datos_originales/43-Becas_Centros_Contactos.csv"
[44] "datos_originales/44-Becas_Centros_Convenios.csv"
[45] "datos_originales/45-Candidatos_Referenciados.csv"
[46] "datos_originales/46-Empresas_Gestores.csv"
[47] "datos_originales/47-Informes_Informe_Personal.csv"
[48] "datos_originales/48-Informes_Informe_Banca_Comercial.csv"
[49] "datos_originales/49-Informes_Informe_Banca_Comercial_Competencias.csv"
[50] "datos_originales/50-Informes_Informe_Banca_Comercial_Areas_Adecuacion.csv"
[51] "datos_originales/51-Candidatos_Comunicados_Parte1.csv"
[52] "datos_originales/52-Candidatos_Comunicados_Parte2.csv"
[53] "datos_originales/53-Candidatos_Comunicados_Parte3.csv"
[54] "datos_originales/54-Comunicados.csv"
rm(files)
En la subcarpeta output/ dejaremos los ficheros de salida ya filtrados y limpiados
Leemos el fichero de maestro de candidatos y vamos a ir eliminando candidatos por diferentes criterios * Primero anonimizados, nombre en blanco, email en blanco, emails ficticios
nombre <- "datos_originales/01-Candidatos_Datos_Personales.csv"
candidatos_maestro <- leerArchivo(nombre)
Read 87.3% of 549653 rows
Read 549652 rows and 25 (of 25) columns from 0.143 GB file in 00:00:03
candidatos_maestro <- filter(candidatos_maestro, NOMBRE != "XXXXXX")
candidatos_maestro <- filter(candidatos_maestro, NOMBRE != "")
candidatos_maestro <- filter(candidatos_maestro, EMAIL != "")
candidatos_maestro <- filter(candidatos_maestro, !(EMAIL %like% "@infojobs"))
candidatos_maestro <- filter(candidatos_maestro, !(EMAIL %like% "@infoempleo"))
candidatos_maestro <- filter(candidatos_maestro, !(EMAIL %like% "@vacio.com"))
candidatos_maestro <- filter(candidatos_maestro, !(EMAIL %like% "@nada"))
De los que quedan, vamos a extraer los ID de candidatos de los actualizados en los últimos 24 meses
fecha_desde <- today() - months(24)
fecha_hasta <- today()
Y nos salen
candidatos_historicos <- candidatos_maestro %>%
filter(dmy_hms(FECHA_ACTUALIZACION) >= fecha_desde) %>%
select(ID_CANDIDATO)
sprintf("Nº de Candidatos: %i", nrow(candidatos_historicos))
[1] "Nº de Candidatos: 92534"
Antes de seguir eliminando candidatos por otros criterios, tenemos que identificar cuáles de ellos están en procesos vivos, no sea que eliminemos candidatos actualizados hace mucho pero que están en un proceso vivo
Tenemos que leer el fichero maestro de procesos de selección (que son tres: especialistas, becarios y masivos) abiertos para identificar qué procesos están “vivos”"
Estos serán los criterios de filtrado a definir por el usuario antes de ejecutar la carga
# Estos filtros no son necesarios si migramos toda España
#gestores_filtro <- c("Naiara Martínez", "Elena Herbosa", "Sara Abad", "Susana Gutierrez", "")
# masivos_filtro <- c("12841","12842")
# becarios_filtro <- c("Naiara Martínez", "Elena Herbosa", "Sara Abad", "Susana Gutierrez", "")
#PENDIENTE DETERMINAR SI USAMOS ALGUN CRITERIO MAS PARA DEFINIR QUE UN PROCESO ESTÉ ACTIVO
nombre <- "datos_originales/19-Procesos_Masivos.csv"
masivos_maestro <- leerArchivo(nombre)
nombre <- "datos_originales/20-Procesos_Especialistas.csv"
especialistas_maestro <- leerArchivo(nombre)
nombre <- "datos_originales/21-Procesos_Becarios.csv"
becarios_maestro <- leerArchivo(nombre)
Bumped column 27 to type character on data row 314, field contains 'Recibidos cv´s de la Licenciatura de Documentación de la Un. Carlos III'. Coercing previously read values in this column from logical, integer or numeric back to character which may not be lossless; e.g., if '00' and '000' occurred before they will now be just '0', and there may be inconsistencies with treatment of ',,' and ',NA,' too (if they occurred in this column before the bump). If this matters please rerun and set 'colClasses' to 'character' for this column. Please note that column type detection uses a sample of 1,000 rows (100 rows at 10 points) so hopefully this message should be very rare. If reporting to datatable-help, please rerun and include the output from verbose=TRUE.
nombre <- "datos_originales/37-Ofertas.csv"
ofertas_maestro <- leerArchivo(nombre)
#procesos_activos <- especialistas_maestro %>%
# filter(ESTADO_PROCESO == "Abierto", GESTOR %in% gestores_filtro) %>%
# select(ID_PROCESO)
procesos_activos <- masivos_maestro %>%
filter(ACTIVO == "Sí") %>%
select(ID_PROCESO) %>%
bind_rows(procesos_activos)
procesos_activos <- becarios_maestro %>%
filter(ESTADO_PROCESO == "Abierto") %>%
select(ID_PROCESO) %>%
bind_rows(procesos_activos)
ofertas_activas <- ofertas_maestro %>%
filter(dmy_hms(FECHA_FIN) > dmy("01-04-2017")) %>%
select(REFERENCIA)
rm(masivos_maestro)
rm(especialistas_maestro)
rm(becarios_maestro)
rm(ofertas_maestro)
Nos salen los siguientes procesos activos, entre becarios, masivos y especialistas
print(nrow(procesos_activos))
[1] 774
Tenemos que extraer los ID de los candidatos asociados a los procesos vivos, independientemente del estado del candidato
nombre <- "datos_originales/33-Procesos_Candidatos_Inscritos.csv"
candidatos_inscritos <- leerArchivo(nombre)
candidatos_inscritos <- tbl_df(candidatos_inscritos)
candidatos_procesos_vivos <- candidatos_inscritos %>%
filter(ID_PROCESO %in% procesos_activos$ID_PROCESO) %>%
select(ID_CANDIDATO)
#Por si acaso, vamos a ver si existen candidatos adicionales en estos otros ficheros
nombre <- "datos_originales/35-Procesos_Especialistas_Progreso.csv"
temp <- leerArchivo(nombre)
candidatos_procesos_vivos <- temp %>%
filter(ID_PROCESO %in% procesos_activos$ID_PROCESO) %>%
select(ID_CANDIDATO) %>%
bind_rows(candidatos_procesos_vivos) %>%
distinct()
#Por si acaso, vamos a ver si existen candidatos adicionales en estos otros ficheros
nombre <- "datos_originales/34-Procesos_Becarios_Progreso.csv"
temp <- leerArchivo(nombre)
Bumped column 9 to type character on data row 32008, field contains '31/01/2011 0:00:00'. Coercing previously read values in this column from logical, integer or numeric back to character which may not be lossless; e.g., if '00' and '000' occurred before they will now be just '0', and there may be inconsistencies with treatment of ',,' and ',NA,' too (if they occurred in this column before the bump). If this matters please rerun and set 'colClasses' to 'character' for this column. Please note that column type detection uses a sample of 1,000 rows (100 rows at 10 points) so hopefully this message should be very rare. If reporting to datatable-help, please rerun and include the output from verbose=TRUE.Bumped column 5 to type character on data row 41145, field contains 'XXX'. Coercing previously read values in this column from logical, integer or numeric back to character which may not be lossless; e.g., if '00' and '000' occurred before they will now be just '0', and there may be inconsistencies with treatment of ',,' and ',NA,' too (if they occurred in this column before the bump). If this matters please rerun and set 'colClasses' to 'character' for this column. Please note that column type detection uses a sample of 1,000 rows (100 rows at 10 points) so hopefully this message should be very rare. If reporting to datatable-help, please rerun and include the output from verbose=TRUE.
candidatos_procesos_vivos <- temp %>%
filter(ID_PROCESO %in% procesos_activos$ID_PROCESO) %>%
select(ID_CANDIDATO) %>%
bind_rows(candidatos_procesos_vivos) %>%
distinct()
#Por si acaso, vamos a ver si existen candidatos adicionales en estos otros ficheros
nombre <- "datos_originales/36-Gestion_Bolsa_Masivos.csv"
temp <- leerArchivo(nombre)
candidatos_procesos_vivos <- temp %>%
filter(ID_PROCESO %in% procesos_activos$ID_PROCESO) %>%
select(ID_CANDIDATO) %>%
bind_rows(candidatos_procesos_vivos) %>%
distinct()
#Por si acaso, vamos a ver si existen candidatos adicionales en estos otros ficheros
nombre <- "datos_originales/41-Candidatos_En_Oferta.csv"
temp <- leerArchivo(nombre)
candidatos_procesos_vivos <- temp %>%
filter(ID_OFERTA %in% ofertas_activas$REFERENCIA) %>%
select(ID_CANDIDATO) %>%
bind_rows(candidatos_procesos_vivos) %>%
distinct()
rm(candidatos_inscritos)
Nos salen
print(nrow(candidatos_procesos_vivos))
[1] 8652
Juntando los candidatos en procesos vivos, y los candidatos actualizados recientemente, tenemos el siguiente número de candidatos
candidatos_a_migrar <- bind_rows(candidatos_procesos_vivos,candidatos_historicos) %>% distinct()
print(nrow(candidatos_a_migrar))
[1] 93312
Vamos a eliminar por tanto todos los candidatos que no estén en esa lista y a ver cuántos quedan
candidatos_maestro <- filter(candidatos_maestro, ID_CANDIDATO %in% candidatos_a_migrar$ID_CANDIDATO)
print(nrow(candidatos_maestro))
[1] 92769
rm(candidatos_a_migrar)
Si no coinciden los números es porque hay candidatos que hemos eliminado previamente por alguno de los otros criterios.
Tampoco cargamos candidatos cuyo CV no está activo
candidatos_maestro <- filter(candidatos_maestro, CV_ACTIVO == "Si")
print(nrow(candidatos_maestro))
[1] 92638
tratamos de arreglar emails inválidos?
emails_incorectos <- filter(candidatos_maestro,!isValidEmail(EMAIL))
print(emails_incorectos["EMAIL"])
eliminamos los emails inválidos
candidatos_maestro <- filter(candidatos_maestro, isValidEmail(EMAIL))
De los candidatos duplicados trataremos de cargar únicamente una ocurrencia. Estos son algunos de los repetidos
emails_repetidos <- candidatos_maestro %>% group_by(EMAIL) %>%
summarise(count = n()) %>%
arrange(desc(count)) %>% filter(count > 1)
print(emails_repetidos)
Eliminamos candidatos duplicados, dejando únicamente duplicados si están asociados a procesos
#Obtenemos una lista de emails y candidatos que no están en procesos vivos
candidatos_a_unificar <- candidatos_maestro %>%
filter(EMAIL %in% emails_repetidos$EMAIL) %>%
select(ID_CANDIDATO) %>%
filter(!(ID_CANDIDATO %in% candidatos_procesos_vivos$ID_CANDIDATO))
candidatos_mantener <- candidatos_maestro %>%
filter(ID_CANDIDATO %in% candidatos_a_unificar$ID_CANDIDATO) %>%
arrange(desc(dmy_hms(FECHA_ACTUALIZACION))) %>%
distinct(EMAIL, .keep_all=TRUE ) %>%
select(ID_CANDIDATO)
candidatos_eliminar <- candidatos_maestro %>%
filter(ID_CANDIDATO %in% candidatos_a_unificar$ID_CANDIDATO) %>%
filter(!(ID_CANDIDATO %in% candidatos_mantener$ID_CANDIDATO)) %>%
select(ID_CANDIDATO)
#Ahora eliminamos estos candidatos del maestro
candidatos_maestro <- filter(candidatos_maestro, !(ID_CANDIDATO %in% candidatos_eliminar$ID_CANDIDATO))
rm(candidatos_a_unificar)
rm(candidatos_mantener)
rm(candidatos_eliminar)
Comprobamos si quedan duplicados
emails_repetidos <- candidatos_maestro %>% group_by(EMAIL) %>%
summarise(count = n()) %>%
arrange(desc(count)) %>% filter(count > 1)
print(emails_repetidos)
Si quedan duplicados puede ser por dos motivos: 1. El candidato está inscrito a más de una oferta de empleo con el mismo email pero diferente ID de candidato 2. El candidato está inscrito a una oferta de empleo (o más) con un email e ID de Candidato y aparece en el histórico con el mismo email pero otro ID de Candidato.
En este caso eliminamos los candidatos que cumplen la casuística número 2, dejando únicamente su ID de candidato que está asociado a alguna oferta de empleo.
#Obtenemos una lista de emails y candidatos que no están en procesos vivos
candidatos_a_unificar <- candidatos_maestro %>%
filter(EMAIL %in% emails_repetidos$EMAIL) %>%
select(ID_CANDIDATO) %>%
filter(!(ID_CANDIDATO %in% candidatos_procesos_vivos$ID_CANDIDATO))
#y nos los cargamos
candidatos_maestro <- filter(candidatos_maestro, !(ID_CANDIDATO %in% candidatos_a_unificar$ID_CANDIDATO))
rm(candidatos_a_unificar)
Comprobamos si quedan duplicados
emails_repetidos <- candidatos_maestro %>% group_by(EMAIL) %>%
summarise(count = n()) %>%
arrange(desc(count)) %>% filter(count > 1)
print(emails_repetidos)
rm(emails_repetidos)
Si en este punto quedan emails repetidos, tenemos un problema ya que se trata de personas que se han apuntado a dos procesos vigentes, con dos IDs de candidato distinto pero idéntico email. En Cornerstone sólo se puede cargar uno de los dos puesto que la clave principal es el email, el usuario de acceso a Cornerstone será el email y además será uno de los medios de contacto con el candidato por lo que no lo podemos cambiar.
PENSAR QUE HACER
A ver cuántos candidatos nos quedan:
fechas <- select(candidatos_maestro,ID_CANDIDATO,FECHA_ACTUALIZACION)
fechas$FECHA_ACTUALIZACION <- as.POSIXct(date(dmy_hms(fechas$FECHA_ACTUALIZACION)))
ggplot(fechas, aes(FECHA_ACTUALIZACION)) +
geom_histogram(aes(fill=..count..)) +
labs(title="Histograma de Candidatos por fecha de última actualización") +
labs(x="Fecha", y="Número de Actualizaciones") +
scale_x_datetime(breaks = date_breaks("12 months"),
labels = date_format("%Y-%b")
)
fechas <- select(candidatos_maestro,ID_CANDIDATO,FECHA_ALTA)
fechas$FECHA_ALTA <- as.POSIXct(date(dmy_hms(fechas$FECHA_ALTA)))
ggplot(fechas, aes(FECHA_ALTA)) +
geom_histogram(aes(fill=..count..)) +
labs(title="Histograma de Candidatos por fecha de alta") +
labs(x="Fecha", y="Número de Altas") +
scale_x_datetime(breaks = date_breaks("24 months"),
labels = date_format("%Y-%b")
)
Ahora tenemos por un lado el listado de candidatos a migrar y por otro el listado de procesos (y ofertas) a migrar. Ahora hay que procesar todos y cada uno de los ficheros CSV de entrada y filtrarlos para dejar únicamente los candidatos, procesos, o la combinación de ámbos.
# Por el momento, en los ficheros de procesos dejamos solo la información de los procesos vivos, eliminando todo lo demás
# Otra opción sería dejar la información de los candidatos históricos también pero modificando el ID de proceso de todos ellos a uno "ficticio" a mapear con el Dummy de cornerstone. Como el requerimiento es cargar candidatos históricos únicamente, (no la información asociada a sus 1 o varios procesos de selección históricos) de momento lo dejamos así.
fileNames <- list.files(path = "datos_originales", pattern="*.csv", full.names=T, recursive=FALSE)
fileNamesOut <- file.path("temp",list.files(path = "datos_originales", pattern="*.csv", recursive=FALSE))
for(x in 1:length(fileNames)) {
t<-leerArchivo(fileNames[x])
if ("ID_PROCESO" %in% colnames(t)) {
t <- t %>% filter(ID_PROCESO %in% procesos_activos$ID_PROCESO)
}
else {
if ("ID_CANDIDATO" %in% colnames(t)) {
t <- t %>% filter(ID_CANDIDATO %in% candidatos_maestro$ID_CANDIDATO)
}
else {
if ("REFERENCIA" %in% colnames(t)) {
t <- t %>% filter(REFERENCIA %in% ofertas_activas$REFERENCIA)
}
else {
t <- t %>% filter("REFERENCIA OFERTA" %in% ofertas_activas$REFERENCIA)
}
}
}
print(fileNames[x])
print(nrow(t))
fwrite(t,fileNamesOut[x], sep = "~")
rm(t)
gc()
}
Read 89.1% of 549653 rows
Read 549652 rows and 25 (of 25) columns from 0.143 GB file in 00:00:03
[1] "datos_originales/01-Candidatos_Datos_Personales.csv"
[1] 88327
Read 66.0% of 1000000 rows
Read 999999 rows and 35 (of 35) columns from 0.245 GB file in 00:00:03
[1] "datos_originales/02-Candidatos_Formacion_Parte1.csv"
[1] 59885
[1] "datos_originales/03-Candidatos_Formacion_Parte2.csv"
[1] 104437
[1] "datos_originales/06-Candidatos_Idiomas.csv"
[1] 130092
[1] "datos_originales/07-Candidatos_Idiomas_Titulaciones.csv"
[1] 27127
[1] "datos_originales/08-Candidatos_Idiomas_Detalles.csv"
[1] 17332
[1] "datos_originales/09-Candidatos_Informatica_parte1.csv"
[1] 102162
[1] "datos_originales/10-Candidatos_Informatica_parte2.csv"
[1] 96313
[1] "datos_originales/11-Candidatos_Informatica_parte3.csv"
[1] 123090
[1] "datos_originales/12-Candidatos_Informatica_parte4.csv"
[1] 124614
Read 83.2% of 733422 rows
Read 733422 rows and 11 (of 11) columns from 0.255 GB file in 00:00:03
[1] "datos_originales/13-Candidatos_Experiencia_Empresas_Parte1.csv"
[1] 150360
[1] "datos_originales/14-Candidatos_Experiencia_Empresas_Parte2.csv"
[1] 8073
[1] "datos_originales/15-Candidatos_Experiencia_Profesional.csv"
[1] 8586
[1] "datos_originales/16-Candidatos_Otros_Datos.csv"
[1] 88327
[1] "datos_originales/17-Candidatos_Otros_Datos_Documentos.csv"
[1] 59212
[1] "datos_originales/18-Candidatos_Agenda.csv"
[1] 1589
[1] "datos_originales/19-Candidatos_Agenda_Citaciones.csv"
[1] 3128
[1] "datos_originales/19-Procesos_Masivos.csv"
[1] 34
[1] "datos_originales/20-Candidatos_Agenda_VEntrevista.csv"
[1] 0
[1] "datos_originales/20-Procesos_Especialistas.csv"
[1] 90
Bumped column 27 to type character on data row 314, field contains 'Recibidos cv´s de la Licenciatura de Documentación de la Un. Carlos III'. Coercing previously read values in this column from logical, integer or numeric back to character which may not be lossless; e.g., if '00' and '000' occurred before they will now be just '0', and there may be inconsistencies with treatment of ',,' and ',NA,' too (if they occurred in this column before the bump). If this matters please rerun and set 'colClasses' to 'character' for this column. Please note that column type detection uses a sample of 1,000 rows (100 rows at 10 points) so hopefully this message should be very rare. If reporting to datatable-help, please rerun and include the output from verbose=TRUE.
[1] "datos_originales/21-Procesos_Becarios.csv"
[1] 100
[1] "datos_originales/22-Procesos_Puestos.csv"
[1] 226
[1] "datos_originales/23-Procesos_VEntrevista.csv"
[1] 0
[1] "datos_originales/24-Procesos_Evaluacion_Candidato_Cp.csv"
[1] 2638
[1] "datos_originales/25-Procesos_Evaluacion_Candidato_Test.csv"
[1] 82
[1] "datos_originales/26-Procesos_Evaluacion_Candidato_Idiomas.csv"
[1] 45
[1] "datos_originales/27-Procesos_Evaluacion_Candidato_Resultados_Parte1.csv"
[1] 0
[1] "datos_originales/28-Procesos_Evaluacion_Candidato_Resultados_Parte2.csv"
[1] 4876
[1] "datos_originales/29-Procesos_Evaluacion_Candidato_Evaluacion_BBVA.csv"
[1] 2638
[1] "datos_originales/30-Procesos_Evaluacion_Candidato_Entrevista_Historico.csv"
[1] 50
[1] "datos_originales/31-Procesos_Citaciones_Eventos.csv"
[1] 72
[1] "datos_originales/32-Procesos_Citaciones_Fases.csv"
[1] 217
[1] "datos_originales/33-Procesos_Candidatos_Inscritos.csv"
[1] 3872
Bumped column 9 to type character on data row 32008, field contains '31/01/2011 0:00:00'. Coercing previously read values in this column from logical, integer or numeric back to character which may not be lossless; e.g., if '00' and '000' occurred before they will now be just '0', and there may be inconsistencies with treatment of ',,' and ',NA,' too (if they occurred in this column before the bump). If this matters please rerun and set 'colClasses' to 'character' for this column. Please note that column type detection uses a sample of 1,000 rows (100 rows at 10 points) so hopefully this message should be very rare. If reporting to datatable-help, please rerun and include the output from verbose=TRUE.Bumped column 5 to type character on data row 41145, field contains 'XXX'. Coercing previously read values in this column from logical, integer or numeric back to character which may not be lossless; e.g., if '00' and '000' occurred before they will now be just '0', and there may be inconsistencies with treatment of ',,' and ',NA,' too (if they occurred in this column before the bump). If this matters please rerun and set 'colClasses' to 'character' for this column. Please note that column type detection uses a sample of 1,000 rows (100 rows at 10 points) so hopefully this message should be very rare. If reporting to datatable-help, please rerun and include the output from verbose=TRUE.
[1] "datos_originales/34-Procesos_Becarios_Progreso.csv"
[1] 101
[1] "datos_originales/35-Procesos_Especialistas_Progreso.csv"
[1] 2105
[1] "datos_originales/36-Gestion_Bolsa_Masivos.csv"
[1] 51
[1] "datos_originales/37-Ofertas.csv"
[1] 14
[1] "datos_originales/38-Ofertas_Plantillas.csv"
[1] 0
[1] "datos_originales/39-Ofertas_Preguntas.csv"
[1] 0
[1] "datos_originales/40-Ofertas_Respuestas.csv"
[1] 0
[1] "datos_originales/41-Candidatos_En_Oferta.csv"
[1] 187513
[1] "datos_originales/42-Becas_Centros.csv"
[1] 0
[1] "datos_originales/43-Becas_Centros_Contactos.csv"
[1] 0
[1] "datos_originales/44-Becas_Centros_Convenios.csv"
[1] 0
[1] "datos_originales/45-Candidatos_Referenciados.csv"
[1] 451
[1] "datos_originales/46-Empresas_Gestores.csv"
[1] 0
[1] "datos_originales/47-Informes_Informe_Personal.csv"
[1] 105
[1] "datos_originales/48-Informes_Informe_Banca_Comercial.csv"
[1] 378
[1] "datos_originales/49-Informes_Informe_Banca_Comercial_Competencias.csv"
[1] 0
[1] "datos_originales/50-Informes_Informe_Banca_Comercial_Areas_Adecuacion.csv"
[1] 9
Bumped column 9 to type character on data row 5952, field contains 'Estudiantes de último curso o recién titulados en la Licenciatura o Grado en Informática.'. Coercing previously read values in this column from logical, integer or numeric back to character which may not be lossless; e.g., if '00' and '000' occurred before they will now be just '0', and there may be inconsistencies with treatment of ',,' and ',NA,' too (if they occurred in this column before the bump). If this matters please rerun and set 'colClasses' to 'character' for this column. Please note that column type detection uses a sample of 1,000 rows (100 rows at 10 points) so hopefully this message should be very rare. If reporting to datatable-help, please rerun and include the output from verbose=TRUE.
[1] "datos_originales/51-Candidatos_Comunicados_Parte1.csv"
[1] 28
[1] "datos_originales/52-Candidatos_Comunicados_Parte2.csv"
[1] 1673
[1] "datos_originales/53-Candidatos_Comunicados_Parte3.csv"
[1] 4093
[1] "datos_originales/54-Comunicados.csv"
[1] 0
Con los ficheros ya filtrados, los vamos procesando uno a uno y realizando limpiezas adicionales
fileNames <- list.files(path = "temp", pattern="*.csv", full.names=T, recursive=FALSE)
fileNamesOut <- file.path("output",list.files(path = "temp", pattern="*.csv", recursive=FALSE))
for(x in 1:length(fileNames)) {
t<-leerArchivo(fileNames[x])
if (fileNames[x] == "temp/01-Candidatos_Datos_Personales.csv") {
t$TELEFONO <- gsub("[^0-9]", "", t$TELEFONO)
t$TELEFONO_MOVIL <- gsub("[^0-9]", "", t$TELEFONO_MOVIL)
}
if (fileNames[x] == "temp/02-Candidatos_Formacion_Parte1.csv") {
t$TITULO <- as.character(t$TITULO)
t$TITULO[t$TITULO==""] <- paste( as.character(t$NIVEL[t$TITULO==""]), as.character(t$AREA[t$TITULO==""]))
t$TITULO <- as.factor(t$TITULO)
}
if (fileNames[x] == "temp/03-Candidatos_Formacion_Parte2.csv") {
t$TITULO <- as.character(t$TITULO)
t$TITULO[t$TITULO==""] <- paste( as.character(t$NIVEL[t$TITULO==""]), as.character(t$AREA[t$TITULO==""]))
t$TITULO <- as.factor(t$TITULO)
}
fwrite(t,fileNamesOut[x], sep = "~")
rm(t)
gc()
}
Vamos a descargar las fotos los adjuntos y los informes y dejarlos en una carpeta llamada output/fotos output/adjuntos y output/informes
proc.time() - ptm